package com.study03;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class TestDemo {
    public static void main(String[] args) {
        Store store = new Store();
        ExecutorService service= Executors.newCachedThreadPool();
        for(int i = 1;i <= 10;i++){
            Thread producter = new Thread(new Producter(store));
            Thread customer = new Thread(new Customer(store));
            producter.start();
            customer.start();
        }
        service.shutdown();

//        while(true){
//            Thread producter = new Thread(new Producter(store));
//            Thread customer = new Thread(new Customer(store));
//            producter.start();
//            customer.start();
//        }
    }
}
